import { LAYOUT } from '@/store/keys'
import { RoleId } from '@/types/role.d'

export const asyncRoutes = [
  {
    path: '/index',
    component: LAYOUT,
    name: 'Index',
    meta: {
      title: '仪表盘',
      iconPrefix: 'iconfont',
      icon: 'icon-dashboard',
      role: [
        RoleId.Admin,
        RoleId.Finance,
        RoleId.Manager
      ],
    },
    children: [
      {
        path: 'custom',
        name: 'custom',
        component: (): any => import('@/views/custom/index.vue'),
        meta: {
          title: '客户管理',
          affix: true,
          role: [
            RoleId.Admin,
            RoleId.Finance,
            RoleId.Manager
          ],
        },
      },
      {
        path: 'flow',
        name: 'flow',
        component: () => import('@/views/flow/index.vue'),
        meta: {
          title: '资金流水',
          role: [
            RoleId.Admin,
            RoleId.Finance,
          ],
        }
      },
      {
        path: 'workPlace',
        name: 'workPlace',
        component: () => import('@/views/flow/workplace.vue'),
        meta: {
          title: '工作台',
          role: [
            RoleId.Admin,
            RoleId.Finance,
            RoleId.Manager
          ]
        }
      }
    ],
  },

  {
    path: '/system',
    // component:() => import('@/layouts/index.vue'),
    component: LAYOUT,
    name: "system",
    meta: {
      title: '系统管理',
      iconPrefix: 'iconfont',
      icon: 'icon-system',
      role: [
        RoleId.Admin,
      ],
    },
    children: [
      {
        path: 'user',
        name: 'user',
        component: (): any => import('@/views/system/user.vue'),
        meta: {
          title: '用户管理',
          affix: true,
          role: [
            RoleId.Admin,
          ],
        },
      },
    ]
  }
]
// {
//   path: 'work-place',
//   name: 'WorkPlace',
//   component: (): any => import('@/views/index/work-place.vue'),
//   meta: {
//     title: '工作台',
//   },
// },
